perm filename RPG.REG[S,DOC] blob sn#156708 filedate 1975-04-27 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00024 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00005 00002	Stanford Artificial Intelligence Laboratory            September 1973
C00007 00003	SAILON 51.1                   Contents                            RPG
C00011 00004	SAILON 51.1                 Introduction                          RPG
C00015 00005	SAILON 51.1              EDIT-Class Commands                      RPG
C00019 00006	SAILON 51.1              EDIT-Class Commands                      RPG
C00020 00007	SAILON 51.1            COMPILE-Class Commands                     RPG
C00024 00008	SAILON 51.1            COMPILE-Class Commands                     RPG
C00028 00009	SAILON 51.1            COMPILE-Class Commands                     RPG
C00029 00010	SAILON 51.1             Options and Features                      RPG
C00033 00011	-110PN 51.1             Options and Features                      RPG
C00037 00012	SAILON 51.1             Options and Features                      RPG
C00042 00013	SAILON 51.1             Options and Features                      RPG
C00047 00014	SAILON 51.1             Options and Features                      RPG
C00051 00015	SAILON 51.1             Options and Features                      RPG
C00056 00016	SAILON 51.1             Options and Features                      RPG
C00061 00017	SAILON 51.1             Options and Features                      RPG
C00065 00018	SAILON 51.1             Options and Features                      RPG
C00067 00019	SAILON 51.1                 CREF Command                          RPG
C00069 00020	SAILON 51.1               Internal Workings                       RPG
C00073 00021	SAILON 51.1               Internal Workings                       RPG
C00077 00022	SAILON 51.1               Internal Workings                       RPG
C00078 00023	SAILON 51.1                Error Messages                         RPG
C00081 00024	
C00082 ENDMK
C⊗;
Stanford Artificial Intelligence Laboratory            September 1973
Operating Note 51.1
















                                 RPG

                       Rapid Program Generator


                         by Ralph E.  Gorin






ABSTRACT:   RPG,  the  Rapid Program  Generator,  is  described.  The
            operating system provides several commands  that activate
            RPG.  RPG  interprets these  commands, and  converts them
            into the form  expected by language  processors, editors,
            and  the  LOADER.  This  simplifies  program preparation.
            RPG remembers the commands  that it has been  given; this
            eliminates the need for repeating arguments in subsequent
            commands.










This work  was supported  in part by  the Advanced  Research Projects
Agency of the Office of  the Secretary of Defense under  Contract No.
DAHC15-73-C-0453
SAILON 51.1                   Contents                            RPG


SECTION                                                          PAGE



1              Introduction                                         1


2              EDIT-Class Commands                                  2
       A.              CREATE, CETV, CTV and MAKE                   2
       B.              EDIT, ETV, TV and TECO                       2


3              COMPILE-Class Commands                               4
       A.              COMPILE                                      4
       B.              LOAD                                         5
       C.              EXECUTE                                      5
       D.              TRY                                          5
       E.              DEBUG                                        5
       F.              PREPARE                                      6
       G.              PUB                                          6


4              Options and Features                                 7
       A.              Switches and Project-Programmer Names        7
       B.              Generation of REL Files                      8
       C.              Concatenation of Source Files                9
       D.              Producing Symbolic Listings                 10
       E.              Command Files                               10
       F.              Generating Core Images and DMP Files        11
       G.              Library Searches                            12
       H.              Nonstandard Processor Features              13
       I.              Translator Switches                         14
       J.              LOADER Switches                             14


5              CREF Command                                        16


6              Internal Workings                                   17


7              Error Messages                                      20







                                  i
SAILON 51.1                 Introduction                          RPG


                      Section 1 - Introduction


        RPG,  the  Rapid  Program Generator,  written  by  William F.
Weiher,  is  a  command  interpreter.   It  simplifies  the  tasks of
editing, compiling,  and loading programs  by expanding  concise user
commands  into  the   different  forms  used  by   editors,  language
processors, and the LOADER.  Without user intervention, RPG  will run
the correct  language processors to  translate the user's  files.  It
will run the LOADER to create an executable core image containing the
user's program.  The operating system provides several  commands that
run RPG.

        RPG knows about certain standard processors.  These are:

Program   Function           Published            On-line
                             document             document

SOS       Editor             SAILON 50.3          SOS.LES[S,DOC]
TV        Editor                                  TVED.DCS[UP,DOC]
TECO      Editor             DEC documentation
E         Editor                                  TV2E.FW[UP,DOC]
                                                  TVED.DCS[UP,DOC]


SAIL      Sail Compiler      AIM 204              SAIL.KVL[AIM,DOC]
FAIL      Assembler          SAILON 26.2          FAIL.PMP[S,DOC]
F4        Fortran Compiler   DEC documentation
MACRO     Assembler          DEC documentation
OSAIL     Old SAIL
NSAIL     New SAIL (as available)
PUB       Document Compiler  SAILON 70            PUB.TES[S,DOC]
                                                  PUBNET.TES[S,DOC]
                                                  PUBSUM.LES[UP,DOC]


RAID      Debugger           SAILON 58.1          RAID.PMP[S,DOC]
DDT       Debugger           DEC documentation

LOADER    Linking Loader     DEC documentation



        The  RPG  commands  are  divided  into  three  classes, EDIT,
COMPILE, and CREF.




                                  1
SAILON 51.1              EDIT-Class Commands                      RPG


                   Section 2 - EDIT-Class Commands


        There are eight EDIT-class commands, two for each of the four
commonly used editors:

                                 Command name
          Program            Create File    Edit File

          SOS                CREATE         EDIT
          E                  CETV           ETV
          TV                 CTV            TV
          TECO               MAKE           TECO

A.     CREATE, CETV, CTV and MAKE

        These commands take  a file name  as the argument.   RPG will
call the editor and tell it to initialize the file of that name.  For
CREATE, SOS is started in line insertion mode.  The tv editors (E and
TV, corresponding to CETV and CTV commands) will initialize  the file
and allow the insertion of  text on page 2.  TECO (the  MAKE command)
will be initialized to write on the specified file.  (Try the command
MAKE LOVE sometime.)

B.     EDIT, ETV, TV and TECO

        These  commands  take  a file  name  (with  optional Project-
Programmer Name) as the argument.  RPG remembers the name of the last
file that was  edited (except that LOGOUT  makes RPG forget).   If an
EDIT-class command  is given  without an argument,  RPG will  use the
argument that it remembered.

        If no extension is specified in the argument and no file with
the given  name and  blank extension  can be  found, then  the user's
directory is  searched for any  file with the  given name and  one of
several standard extensions.  The standard extensions are searched in
the order:  NSA, OSA, SAI, FAI, MAC, F4, LST, WRU, PUB, and CMD.

        If a user  specifies a disk area  other than his  own current
(logged in or aliased) area then  the edited file will be put  on his
disk area and the source (from the other area) will not be changed.

        The  editors have  a  read-only mode  in which  files  may be
examined by using editor commands, but not changed.  To get read-only
mode  type  /R  after  the  file  name  in  the  edit  command (e.g.,
ETV M.SAI/R).   Read-only mode  in  SOS prohibits  any  commands that
would change the  file.  In the tv  editors, the mode may  be changed


                                  2
SAILON 51.1              EDIT-Class Commands                      RPG


from read-only  to read-write  at any time.   In TV,  there is  a no-
directory mode, specified by the switch /N.















































                                  3
SAILON 51.1            COMPILE-Class Commands                     RPG


                 Section 3 - COMPILE-Class Commands


        The COMPILE-class commands  are an abbreviation for  a series
of  commands to  compilers (and  other language  processors)  and the
LOADER.

                   Brief summary of the commands:

           REL file  Core Image   Debugger   Execution

COMPILE    yes
LOAD       yes       yes
PREPARE    yes       yes          yes
EXECUTE    yes       yes                     starts the user program
TRY        yes       yes          yes        starts the user program
DEBUG      yes       yes          yes        starts the debugger
PUB        compiles a document, producing a DOC file

        The COMPILE-class commands remember their arguments, like the
EDIT-class commands.  The argument list, if omitted, defaults  to the
last set of arguments  that were given.  Arguments are  remembered in
the disk files QQSVCM.RPG (COMPILE-class) and QQSVED.RPG (EDIT-class)
which are usually deleted by the logout program.

A.     COMPILE

        The  argument  should  be  one  or  more   file  descriptors,
separated by commas.  RPG will cause the appropriate translator to be
used  for  each  of  the  files.   The  translator  that  is  used is
determined  by  the  the  extension  of  each  file.    The  standard
extensions and translators are:

                   Extension      Translator

                   SAI            SAIL
                   F4             FORTRAN
                   FAI            FAIL
                   blank          FAIL
                   MAC            MACRO
                   OSA            OSAIL (Old SAIL)
                   NSA            NSAIL (New SAIL)

        The decision about whether  to compile is made for  each file
by comparing the source  file date (and time) with  the corresponding
REL file date.  If there is no REL file, or if the text file has been
edited since the creation of the REL file, then the source  file will


                                  4
SAILON 51.1            COMPILE-Class Commands                     RPG


be translated again.  If the  REL file is up to date,  no compilation
is done.  For example, if the files FOO.FAI, GARP.FAI, and BAZ.F4 are
to be compiled, the command: COMPILE FOO,GARP,BAZ would  be suitable.
Only  those  files that  have  changed since  the  creation  of their
corresponding REL files will be compiled.

        The  COMPILE-class  commands, like  the  EDIT-class commands,
remember their argument list.   If the user does not  supply explicit
arguments, RPG uses the same arguments that were used on the previous
COMPILE-class command.  Note that the COMPILE-class arguments and the
EDIT-class  arguments   are  remembered  separately.    RPG  actually
remembers the last COMPILE-class command that had explicit arguments;
both the command  and the arguments  are remembered.  This  is useful
because all the editors allow  an exit-and-go command (in SOS,  the G
command; in TV and E the <CTRL>XG command; in TECO, the  EG command).
The exit-and-go feature runs RPG in a special way which makes RPG re-
execute the command that it remembered.

        Note that the COMPILE command does not produce a  core image.
To  get  an executable  core  image one  of  the  other COMPILE-class
commands must be used.

B.     LOAD

        LOAD does a COMPILE if necessary and then starts  the LOADER.
The LOADER takes the REL  files that were generated by  the compilers
and combines them into an executable core image.  When the  LOADER is
done it exits  to the monitor.  This  command makes a core  image but
does not start it.  If any SAIL program is loaded, the LOADER will be
instructed to request the current SAIL segment.

C.     EXECUTE

        This is like LOAD, but instead of exiting, the  LOADER starts
the program it loaded at its specified starting address.

D.     TRY

        TRY  is  like  EXECUTE,  but it  loads  a  debugger  (RAID at
displays, otherwise DDT) with the user program(s).   Execution starts
at the program's starting address.

E.     DEBUG

        DEBUG is like TRY except that rather than starting the user's
program it starts the debugger  (RAID or DDT) instead.  The  user may
give  commands  to  the  debugger  to  start  his  program,  to plant
breakpoints, etc.

                                  5
SAILON 51.1            COMPILE-Class Commands                     RPG


F.     PREPARE

        PREPARE is like LOAD, but a debugger (RAID or DDT)  is loaded
with the user's program.

G.     PUB

        The  PUB  command  will  run the  PUB  program  to  compile a
document.  The command takes one file as the argument.   The compiled
document is a DOC  file, not a REL  file.  Switches may be  passed to
PUB by this command, see Section 4.I.






































                                  6
SAILON 51.1             Options and Features                      RPG


                  Section 4 - Options and Features


A.     Switches and Project-Programmer Names

        Switches are allowed in COMPILE-class commands by including a
slash (/) and the switch name, e.g., /LIST.  Switches allow  the user
to select options.  In general, a switch placed before a file name is
sticky,  i.e., it  applies to  all the  terms that  follow.  Switches
placed  after a  file name  are not  sticky; they  apply only  to the
preceding term.

        Many switches have inverse  switches that undo the  effect of
the  switch.   For example  /NOLIST  is the  inverse  of  /LIST.  The
inverse setting is the default for all switches.

        A  Project-Programmer Name  (PPN) may  be included  with each
file name in the command.  The PPN specifies the disk area from which
the  file  is to  be  read.   The PPN,  enclosed  in  square brackets
([ and ]), usually follows a file name; in this case the  PPN applies
only to the preceding term.  If a PPN appears before a file name then
that PPN is sticky for  the rest of the command until  another sticky
PPN is seen.

        A name  followed by a  colon (:) is  a device name  (which is
sticky).

Switch Function Summary

/COMPILE            Force re-compilation  without checking  the dates
                    of REL files
/CREF               Request a cross-reference listing
/DUMP               Force the LOADER to  make a DMP file of  the core
                    image
/FAIL               Use FAIL for this term
/FORTRAN            Use F4 (Fortran) for this term
/FORWARD            Prevent RPG from looking for this file  to decide
                    if the REL file is up to date
/LIBRARY            Force the LOADER to search this term as a library
/LIST               Request a listing file
/MACRO              Use MACRO to translate this term
/MAP                Request a LOADER map of global symbols
/NODUMP             Force  re-loading without  checking the  dates of
                    DMP files
/NOLOAD             Prevent a loading request for this term
/NOSAISEG           Prevent SAIL programs from using a segment.
/NONSTANDARD        Specify a nonstandard processor
/NSAIL              Use NSAIL (New SAIL) to translate this term.

                                  7
-110PN 51.1             Options and Features                      RPG


/OSAIL              Use OSAIL (Old SAIL - 1971 version)  to translate
                    this term
/PUB                Use PUB to translate this term
/REL                Force   loading   from  the   REL   file  without
                    considering the source files
/SAIL               Use SAIL to translate this term

         Switch Names and Abbreviations

 Switch name        Abbreviation    Inverse name    Abbreviation

/COMPILE            /COM            /NOCOMPILE      /NOC
/CREF               /C              /NOLIST         /N
/DUMP               /D
/FAIL               /F
/FORTRAN            /FORT
/FORWARD            /FORW           /NOTFORWARD     /NOT
/LIBRARY            /LIB            /NOSEARCH       /NOS
/LIST               /L              /NOLIST
/MACRO              /M
/MAP
/NODUMP             /NOD
/NOLOAD             /NOLO           /LOAD           /LO
/NONSTANDARD        /NON
/NOSAISEG           NOS
/NSAIL              /NSA
/OSAIL              /OSA
/PUB
/REL                /R
/SAIL               /S

B.     Generation of REL Files

        The simplest way to  translate several programs is  to create
them with file extensions which define the processor to be used; then
give  a single  COMPILE  command with  all these  names  separated by
commas.  (It is usually a bad idea to have two programs  in different
languages with the same file name, e.g., FOO.SAI and FOO.FAI.)

        RPG does not require file extensions to be  typed explicitly.
For the command COMPILE FOO, RPG will look for any file named FOO and
check its extension.  If  a file FOO is  found that does have  one of
the   standard  extensions,   RPG  will   select   the  corresponding
translator.

        If a file does not have a standard extension, RPG can be told
which translator  to use  by giving that  information in  the command


                                  8
SAILON 51.1             Options and Features                      RPG


string.   For  example, to  translate  the file  SINE  with  the SAIL
compiler use the command:  COMPILE SINE/SAIL.  If there is a  list of
several file names,  the processor name may  be used after  each file
name, or before the entire list.  For example,
        COMPILE FOO/SAIL,BAZ/SAIL
is the same as
        COMPILE /SAIL FOO,BAZ.
The command:
        COMPILE /SAIL SINE,IOPACK/FAIL,TJ
would use SAIL  on SINE and  TJ, and would  use FAIL on  IOPACK.  The
default processor is FAIL, initially.  Caution: if a file does have a
standard (non-null)  extension RPG  cannot be  convinced to  use some
other processor.

        Every time a switch like /FORTRAN appears in front of  a file
name, it changes the normal mode.  For example,
        COMPILE /SAIL SINE,COSINE, /FORTRAN TANGNT,COSEC
would cause SINE and COSINE to be translated by SAIL, and  TANGNT and
COSEC to be translated by FORTRAN.

        The compilations  that are requested  will not take  place if
there already exists  a REL file whose  creation date is  more recent
than all of the files used in producing that REL file.  If any source
file is  edited it will  have its creation  time and date  updated so
that it will force re-compilation.  A user may  force re-compilation,
if he wishes, by including /COMPILE in the command line.  That is,
        COMPILE /COMPILE FOO
will  compile the  file FOO  regardless of  its creation  date.  Date
checking can be forced  again by including /NOCOMPILE in  the command
line.   Including /REL  will cause  RPG to  forget about  looking for
source files at all and just proceed to generating a core  image from
the existing REL files.

C.     Concatenation of Source Files

        It is  often desirable  to break  up a  program into  two (or
more) separate files which have only one END statement at the  end of
the last file.  One reason for breaking up a program is because it is
very long, and it would be inconvenient to keep and edit such a large
file.  Another reason for separating a program is to allow  a portion
of the  program text to  be shared.  Several  files can  be processed
together as one big  translation by separating their names  with plus
signs (+) rather than with commas.  For example,
        COMPILE DATA+PROGRM
treats the files DATA and PROGRM  as if they were one large  file and
produces one  relocatable binary file,  PROGRM.REL.  A maximum  of 40
files may be combined in this way.  RPG will not  allow concatenation
of source files that specify inconsistent processors.

                                  9
SAILON 51.1             Options and Features                      RPG


        Normally, the REL file will have the name of the last file in
the command string;  it can be given  some other name by  putting the
desired name  and an  equals sign (=)  at the  front of  the argument
list, e.g.,
        COMPILE FOO=SYMS+PROGRM+IOPACK
would do one translation as if SYMS, PROGRM and IOPACK were one large
file and produce relocatable binary output on the file FOO.REL.

        Occasionally, a  header file must  be assembled  with several
other files, e.g.,
        COMPILE ACUMS+SINE,ACUMS+COSINE,ACUMS+TANGNT.
The brokets (< and >) feature allows this to be done more simply:
        COMPILE ACUMS+<SINE,COSINE,TANGNT>.

D.     Producing Symbolic Listings

        Assembly listings have the original code as it appears in the
file plus the octal values that the code represents with the relative
locations  that the  octal values  go in.   Assembly listings  can be
generated  by means  of a  /LIST or  /CREF  (Cross-Reference Listing)
switch in the command.  The /LIST switch will produce a file with the
same name  as the REL  file and  extension LST.  Such  a file  may be
spooled  or  typed.   Note  that  COMPILE FOO/LIST  will  not compile
anything if a current FOO.REL exists.  This is another instance where
the /COMPILE  switch is useful.   The /LIST may  be used as  a sticky
switch or it may be applied to particular terms.  The  inverse switch
is /NOLIST.

        If the /CREF switch  appears, instead of /LIST,  it generates
an  expanded  listing  that  includes  a  list  of  all  the  symbols
(identifiers) used in the program and the line numbers on  which each
symbol  appears.  This  is called  a Cross-Reference  listing.  These
listing  files cannot  be printed  directly.  Instead,  they  must be
processed by the cross-reference lister program, CREF.  This  is done
by the CREF  command (see Section 5).   Note: not all  the processors
can  produce  a  cross-reference  listing.   Consult  the appropriate
manual to find out if a given processor is capable of generating one.

E.     Command Files

        COMPILE-class commands are sometimes  too long to fit  on one
line, or are too complex to be typed correctly every time.   To solve
this problem, arguments can be read from a file.  The  text contained
in  such a  file  is read  by RPG  as  if it  had been  typed  as the
arguments to a command.

        The  command file  may contain  any features  available  in a


                                 10
SAILON 51.1             Options and Features                      RPG


COMPILE-class command.  Also,  if the command is  too long to  fit on
one line of the  file, a semi-colon (;) placed  at the end of  a line
signifies that the  argument list will continue  on the next  line of
the file.

        To use a term as a  command file write an at sign  (@) before
the command file name,  e.g., LOAD @SYS.  The command file  SYS might
look like  the following file  which is used  to assemble  the entire
operating system:

        %S%B SYSTEM=OUTER(XLR)+JOBDAT+ALLDAT+IMPDDB;
        +LOWCOR+PARSER+SYSINI+COMCSS+CLKSER+UUOCON+SCHEDU+CORE;
        +DSKSER+DSKINT+DTCSER+MTCSER+XGPSER+FBPACK;
        +IMPCLK+IMPREG+IMPUUO+IMPINT;
        +LPTSER+PTPSER+PTRSER;
        +DPYSER+TTYSER+LINED+SPWSER+TVSER+ADSER+MAIL;
        +PATCH+SYSMAK+DDT+ONCE

        There are two things in this command file which have  not yet
been  explained, LOADER  Switches  (see Section  4.J)  and Translator
Switches (see Section 4.I).

F.     Generating Core Images and DMP Files

        The  commands  EXECUTE,  DEBUG, LOAD,  PREPARE  and  TRY each
generate  an  executable  core  image.   Core  images  are   made  by
translating  source  files  (as in  the  COMPILE  command),  and then
running the  LOADER which  takes the  REL files  and produces  a core
image from them.

        With DEBUG, PREPARE and TRY, the LOADER is instructed to load
a copy of RAID (or DDT if the user is at a teletype) and  the program
symbol table with the core image.

        If  /MAP  is included  in  the command  string,  the absolute
values of all the global symbols  are listed in a legible way  on the
file MAP.MAP.

        A disk dump of the core image can be made by  including /DUMP
in the command string.  The dump file will have the same name  as the
first REL  file and extension  DMP.  The DMP  file can be  given some
other name by putting  the desired name and  a left arrow (←)  in the
command string.  For example, the command
        TRY DUMP←SINE,COSINE/DUMP
translates  the  programs  SINE and  COSINE,  producing  SINE.REL and
COSINE.REL.  The LOADER is  run.  Because the TRY command  requests a
debugger,  RAID.REL  (or DDT.REL)  is  loaded from  the  system area.


                                 11
SAILON 51.1             Options and Features                      RPG


SINE.REL and  COSINE.REL are  loaded next.  Then  the LOADER  makes a
dump copy  of the  core image in  the file  DUMP.DMP, and  starts the
program.

        If there already exists a  DMP file of the right name  and if
it has a creation date more recent than those of the source files, no
loading will be done.  Instead,  the dump copy itself will  be called
in.  Reloading  may be forced  by the /NODUMP  switch in  the command
line.  Both  an equals sign  and a  left arrow may  be included  in a
command string.  For example:

 COMMAND                              REL           DMP

TRY SINE+COS/DUMP                    COS.REL       COS.DMP
TRY DUMP←SINE+COS/DUMP               COS.REL       DUMP.DMP
TRY DUMP=SINE+COS/DUMP               DUMP.REL      DUMP.DMP
TRY FOO←DUMP=SINE+COS/DUMP           DUMP.REL      FOO.DMP

G.     Library Searches

        Several REL files may be combined into a library.   A library
is  a  special REL  file  from which  routines  may  be independently
selected.  Library  files are  made by  combining REL  files together
using the FUDGE2 program  (which is described in  DEC documentation).
For example,  sine, cosine,  and tangent  routines might  be combined
into a trig  library, TRIG.REL.  Then,  if a particular  program used
just the sine routine, instead of loading the entire trig  package it
would  be able  to select  only the  sine routine.   The  LOADER will
search library files and load only the programs that are needed.  The
/LIBRARY switch after the name of a library file tells RPG to request
this  LOADER feature.   The /LIBRARY  switch may  also be  used  as a
sticky switch; its inverse is /NOSEARCH.  Suppose there is  a program
called NLT which uses the sine routine that was included in TRIG.REL.
Then the  command LOAD NLT,TRIG/LIBRARY will  cause NLT to  be loaded
and  TRIG  to be  searched.   The LOADER  notices  that  NLT requires
SINE.REL and searches TRIG.REL for it.  Suppose another program, XLT,
requires routines  from two library  files, TRIG.REL  and IOPACK.REL,
and must  be loaded  with another program  LT.  Then  any one  of the
following commands could do this:

        LOAD XLT,LT,/LIBRARY TRIG,IOPACK
        LOAD /LIBRARY XLT/NOSEARCH,LT/NOSEARCH,TRIG,IOPACK
        LOAD XLT,LT,TRIG/LIBRARY,IOPACK/LIBRARY

        Programs which  use library files  must be placed  before the
library file names in the command.  This is because the LOADER cannot
know what routines to extract  from each library until it  has loaded
the programs that require library routines.

                                 12
SAILON 51.1             Options and Features                      RPG


H.     Nonstandard Processor Features

        Processors other than SAIL, FAIL, FORTRAN, PUB, or  MACRO may
be specified by using the non-standard processor feature.  The switch
/NONSTANDARD DEV:NAME  specifies  a nonstandard  processor.   In this
switch, DEV  (assumed to  be DSK, if  absent) is  the device  name on
which  to  find NAME.DMP,  the  core image  file  of  the nonstandard
processor.  Once the /NONSTANDARD switch is used, RPG  will recognize
the extension  NAM (i.e.,  the first three  letters of  the processor
name) and the switch /NAME (the processor name) in the  command line.
A Project-Programmer Name may be used in specifying  the non-standard
processor.

        For example, for a user to translate the program SINE using a
processor named  PROC on  his disk  area, he  could use  the command:
COMPILE SINE/NONSTANDARD PROC.

        Processors used  this way  must have  been designed  for such
usage; not  just any  program will  work.  For  details about  what a
processor must do, see "Internal Workings", Section 6.

        When a standard processor  (except PUB) is used, it  is known
that it will take a text  source file and produce a binary  REL file,
and possibly a text  LST file.  With nonstandard processors  there is
no such guarantee.  A  nonstandard processor may process a  text file
into a new text file which becomes input to a standard processor.  It
is possible to specify all these functions in a  single COMPILE-class
command.

        If a nonstandard processor generates a text file instead of a
REL file, loading must be inhibited.  The /NOLOAD switch accomplishes
this.  The /NOLOAD  switch must be used  for each term that  does not
produce  a REL  file (except  in the  COMPILE command  which  does no
loading anyway).  The inverse switch is /LOAD.

        Suppose the preprocessor, NSP, translates the file BAZ into a
file FOO which is a FAIL program.  FOO must be translated when NSP is
done.  Also, MAIN  and SINE must be  translated and loaded  with FOO.
The command:
        LOAD FOO=BAZ/NONSTANDARD NSP/NOLOAD,MAIN,SINE,FOO/FORWARD
will do all  of this.  The /FORWARD  switch is necessary  because the
file FOO does not exist at the time the command is  given.  Including
the  /FORWARD switch  prevents  RPG from  looking for  FOO;  RPG will
assume that FOO magically appears before FAIL is called.  The inverse
switch is /NOTFORWARD.

        The processor DO (see DO.RPH[UP,DOC]) is another example of a


                                 13
SAILON 51.1             Options and Features                      RPG


nonstandard processor.  The DO program writes QQSVCM.RPG to force the
exit-and-go command from the editors to run DO again.

I.     Translator Switches

        Switch names enclosed  in parentheses "(" and ")"  are passed
directly  to  the  translator.  The  documentation  for  each  of the
translators  explains  what  switches  are  available.   The switches
passed  in  this  way  appear  on  the  source   file  specification.
Sometimes it is  necessary to put switches  on the binary  or listing
term.  For this purpose, there are two other switch constructions.

        The  construction (#1,#2),  where #1  and #2  are  any switch
strings, passes #1 to the binary term and #2 to the source term.  The
construction  (#1,#2,#3) passes  #1  to the  binary term,  #2  to the
listing term, and #3 to the source term.  For example,
        COMPILE/LIST FOO(AX,BY,CZ)
will pass  the switch  string "AX" to  the binary  term, "BY"  to the
listing term, and "CZ" to the source term.

J.     LOADER Switches

        Switches to  the LOADER may  be specified in  a COMPILE-class
command.  A percent sign (%) followed by a letter (or a number  and a
letter)  in the  command string  of one  of the  LOAD,  TRY, EXECUTE,
PREPARE, or  DEBUG commands,  directly specifies  that switch  to the
LOADER.  The following are the legal LOADER switches:

%A     Causes a listing of all global symbols to be printed.
%B     BLT symbols down when done loading.
%C     Chain beginning with Common.
%D     Load DDT.
%E     Start up program when done loading.
%F     Enter library search mode.  Search all default libraries.
%G     Finish loading, make final links and exit.
%H     Load and start RAID.
%I     Ignore starting address of this program.
%J     Use starting address of this program.
%nK    Adjust to n K of core when done loading.
%L     Search this file as a library.
%M     Print storage map.
%N     Leave library search mode.
%nO    Set program origin to n, absolute.
%P     Inhibit automatic library search for undefined globals.
%Q     Allow automatic library search.
%R     Chain beginning with resident module.
%S     Load symbol table also.
%T     Load and start DDT.

                                 14
SAILON 51.1             Options and Features                      RPG


%U     Print current list of undefined globals.
%V     Load RAID.
%W     Load without symbols.
%X     Do not list all globals.
%Y     Load SAILOW for 2 segment SAIL programs.
%Z     Restart LOADER.
%<     Load high segment.

        For a full description  of what these switches  mean, consult
the  DEC  LOADER documentation.   The  LOADER has  been  modified for
Stanford, so  the DEC documentation  does not accurately  reflect the
state of the software.  Consult a wizard if necessary.





































                                 15
SAILON 51.1                 CREF Command                          RPG


                      Section 5 - CREF Command


        This command causes a  cross-reference listing to be  made on
the line  printer.  All  the files  made from  COMPILE-class commands
which  used the  /CREF switch  are listed.  (LOGOUT makes  RPG forget
which  listing files  to process.)   The CREF  command  activates RPG
which in turn activates the CREF program in a special way.   The CREF
program when activated in this way reads a file that RPG  wrote which
contains the names of the files to process.







































                                 16
SAILON 51.1               Internal Workings                       RPG


                    Section 6 - Internal Workings


        Each  COMPILE-class command  does a  great deal  of invisible
work.  The command  COMPILE A,B causes the  monitor to run  RPG.  RPG
reads the command line,  and looks for all  the files named A  and B.
If RPG finds  A.SAI and B.SAI then  it generates the  file QQSAIL.RPG
(if A and B were  FAIL programs, the file would be  QQFAIL.RPG) which
contains these commands:
        A←A.SAI
        B←B.SAI

        RPG then activates SAIL in a special way, by starting  it one
instruction beyond SAIL's  normal starting location.   This technique
of  starting  one beyond  the  normal starting  address  is  known as
"Startup in RPG Mode" because of the use RPG makes of this feature.

        When SAIL is started in RPG Mode, instead of reading commands
from the user console as it would do normally, it reads QQSAIL.RPG as
a command file.   SAIL deletes the command  file when it  is finished
reading it.

        If there were no RPG, the user would have to type:

        R SAIL 
        A←A.SAI
        B←B.SAI

        to get the same effect as the command COMPILE A,B.

        For  a  nonstandard  processor, the  RPG  file  has  the name
QQNAME.RPG where "NAME" is the first four characters of the processor
name (fewer  if the processor  name is short).   For example,  if the
nonstandard  processor  name  were  NSP,  its  commands  would  be on
QQNSP.RPG.   If  its  name  were PREPRO,  its  commands  would  be on
QQPREP.RPG.

        Commas  in  the command  are  changed by  RPG  into carriage-
returns in  the command  file.  There are  several other  mappings of
this  nature, for  instance, equals  sign (=)  gets mapped  into left
arrow (←) and plus sign (+) becomes comma (,).

        All the standard processors accept commands of the form:

DEV:OFILE,DEV:LFILE←DEV:FILE1,DEV:FILE2, .  .  .  ,DEV:FILEn

DEV is any  standard device name, which  if omitted defaults  to DSK.


                                 17
SAILON 51.1               Internal Workings                       RPG


OFILE, if present, is the name of the binary (or other)  output file.
The LFILE  term, if present,  is the name  the listing file.   If any
output term is missing, there will be no corresponding output.

        RPG has a  mechanism to pass  control from one  translator to
another. This is  accomplished by a  special command included  in the
command  file  sent to  each  translator.  The  command:  NAME!  to a
standard processor means to  run the program called  NAME.DMP located
on the system area [1,3].  If the processor to which this  command is
given was started in RPG  Mode then the processor NAME.DMP  should be
started in RPG Mode too.

        When the LOADER is started in RPG Mode it reads commands from
QQLOAD.RPG instead of from the user console.

        By means of  this feature, RPG  can force each  translator to
pass control to  another translator or  to the LOADER.   For example,
the command:
        EXECUTE BAZ.SAI,FOO.FAI
causes RPG to generate the following files:

QQFAIL.RPG   QQSAIL.RPG   QQLOAD.RPG       QQSVCM.RPG

FOO←FOO.FAI  BAZ←BAZ.SAI  /0Y/EBAZ,FOO/G   EXECUTE BAZ.SAI,FOO.FAI
SAIL!        LOADER!

        After making these  files, RPG will  start FAIL in  RPG Mode.
QQSVCM.RPG is  the file  where RPG  remembers the  last COMPILE-class
command that had arguments.  When RPG is started in RPG Mode it reads
this file and performs that command again.

        Nonstandard processors must  accept commands in  the standard
form; they must  be capable of reading  commands from an RPG  file if
started in RPG Mode.  RPG files should be deleted when  the processor
is finished reading the  commands.  The exclamation point  feature is
required.

        Editor programs have other conventions.  When started  in RPG
Mode, they have their accumulators loaded with parameters:

       Register    Data

       11          Project-Programmer Name
       13          Left: File Extension, Right: Flags
       14          File Name
       15          Left: Attached Lines Count, Right: Current Line
       16          Current Page


                                 18
SAILON 51.1               Internal Workings                       RPG


       Flags in the right side of 13 are:
       400000      Create
       200000      Readonly
       100000      No Directory (TV only)
        40000      Update File Version Page (TV only)












































                                 19
SAILON 51.1                Error Messages                         RPG


                     Section 7 - Error Messages

                           Obvious errors

COMMAND ERROR
TOO MANY SWITCHES
UNRECOGNIZABLE SWITCH
DEVICE NOT AVAILABLE
TOO MANY NON-STANDARD PROCESSORS


                            Subtle errors

UFD HASHING ERROR INCITED BY DCS
        Probably you have too many files on one disk area.

TOO MANY NAMES
        Your  command included  too many  file names  or non-standard
        processor names.

PROCESSOR CONFLICT
        A + construction  specified files with  different extensions,
        e.g., COMPILE FOO.SAI+BAZ.FAI

NESTING TOO DEEP
        Too many levels of command files.

NO SUCH FILE
        Some LOOKUP  failed.  A  file named in  the command  does not
        exist


           Horrible errors (A wizard should be consulted)

DISK NOT AVAILABLE
INPUT ERROR READING UFD
INPUT ERROR
NOT ENOUGH CORE

OUTPUT ERROR
        Some file could not be written correctly. Possibly a  file is
        write protected.  Otherwise you may need help.

UFD LOOKUP FAILURE
        You are aliased to a non-existent disk area.   Otherwise, you
        need a wizard.



                                 20